package com.pengxh.autodingding.greendao;

import com.pengxh.autodingding.bean.DateTimeBean;
import com.pengxh.autodingding.bean.DingTaskLogBean;
import com.pengxh.autodingding.bean.NotificationBean;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import java.util.Map;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 *
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig dateTimeBeanDaoConfig;
    private final DaoConfig dingTaskLogBeanDaoConfig;
    private final DaoConfig notificationBeanDaoConfig;

    private final DateTimeBeanDao dateTimeBeanDao;
    private final DingTaskLogBeanDao dingTaskLogBeanDao;
    private final NotificationBeanDao notificationBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        dateTimeBeanDaoConfig = daoConfigMap.get(DateTimeBeanDao.class).clone();
        dateTimeBeanDaoConfig.initIdentityScope(type);

        dingTaskLogBeanDaoConfig = daoConfigMap.get(DingTaskLogBeanDao.class).clone();
        dingTaskLogBeanDaoConfig.initIdentityScope(type);

        notificationBeanDaoConfig = daoConfigMap.get(NotificationBeanDao.class).clone();
        notificationBeanDaoConfig.initIdentityScope(type);

        dateTimeBeanDao = new DateTimeBeanDao(dateTimeBeanDaoConfig, this);
        dingTaskLogBeanDao = new DingTaskLogBeanDao(dingTaskLogBeanDaoConfig, this);
        notificationBeanDao = new NotificationBeanDao(notificationBeanDaoConfig, this);

        registerDao(DateTimeBean.class, dateTimeBeanDao);
        registerDao(DingTaskLogBean.class, dingTaskLogBeanDao);
        registerDao(NotificationBean.class, notificationBeanDao);
    }

    public void clear() {
        dateTimeBeanDaoConfig.clearIdentityScope();
        dingTaskLogBeanDaoConfig.clearIdentityScope();
        notificationBeanDaoConfig.clearIdentityScope();
    }

    public DateTimeBeanDao getDateTimeBeanDao() {
        return dateTimeBeanDao;
    }

    public DingTaskLogBeanDao getDingTaskLogBeanDao() {
        return dingTaskLogBeanDao;
    }

    public NotificationBeanDao getNotificationBeanDao() {
        return notificationBeanDao;
    }

}
